package com.hc.ssm.feign;


import com.hc.ssm.pojo.Member;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class IMemberFeignFallbackFactory implements FallbackFactory<IMemberFeign> {

    @Override
    public IMemberFeign create(Throwable cause) {
        return new IMemberFeign() {
            @Override
            public String getMemberById(Integer id) {
                return "当前人数太多请稍后查看!!!";
            }

            @Override
            public void addMember(Member member) {

            }

            @Override
            public List<Member> getMemberList() {
                return null;
            }

            @Override
            public Member getMemberById2(Integer id) {
                return new Member(-1,"当前系统流浪去了,稍后在来！！");
            }
        };
    }
}
